SET( LIB_NAME OpenIG-Plugin-ModelComposition )
SET( TARGET_OTHER_FILES 
	DataFiles/libIgPlugin-ModelComposition.so.xml
	DataFiles/a320.ive.xml
)

ADD_LIBRARY( ${LIB_NAME} SHARED
    IGPluginModelComposition.cpp
    ${TARGET_OTHER_FILES}
)

IF (OPENGL_FOUND)
    IF(APPLE)
       SET(CMAKE_CXX_LINK_FLAGS "-framework OpenGL")
    ENDIF(APPLE)
    INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
ENDIF (OPENGL_FOUND)

INCLUDE_DIRECTORIES(
	${Boost_INCLUDE_DIRS}	
)

TARGET_LINK_LIBRARIES( ${LIB_NAME}
    ${OSG_LIBRARIES}
    OpenIG-Engine
	OpenIG-Utils
    ${OPENGL_LIBRARIES}
	${Boost_LIBRARIES}
)

SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES VERSION ${OPENIG_VERSION} )
SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES SOVERSION ${OPENIG_VERSION} )
SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES PROJECT_LABEL "Plugin ModelComposition" )

INCLUDE( PluginInstall REQUIRED )

IF (APPLE)
    INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/DataFiles/libIgPlugin-ModelComposition.so.xml DESTINATION ${INSTALL_LIBDIR} RENAME libOpenIG-Plugin-ModelComposition.dylib.xml)
ELSEIF(WIN32)
    INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/DataFiles/libIgPlugin-ModelComposition.so.xml DESTINATION ${INSTALL_BINDIR} RENAME OpenIG-Plugin-ModelComposition.dll.xml)
ELSE()
    INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/DataFiles/libIgPlugin-ModelComposition.so.xml DESTINATION ${INSTALL_LIBDIR} RENAME libOpenIG-Plugin-ModelComposition.so.xml)
ENDIF()
